package com.changpay.zywy.adapter

import android.content.Context
import com.chad.library.adapter.base.BaseQuickAdapter
import com.chad.library.adapter.base.BaseViewHolder
import com.changpay.zywy.R
import com.changpay.zywy.bean.ShopGoodsBean
import com.changpay.zywy.utils.ImageLoader

/**
 * Created by chenxz on 2018/4/22.
 */
class ShopGoodsAdapter(private val context: Context?, datas: MutableList<ShopGoodsBean.GoodsListBean.GoodsInfoBean.DataBean>) :
    BaseQuickAdapter<ShopGoodsBean.GoodsListBean.GoodsInfoBean.DataBean, BaseViewHolder>(R.layout.item_shop_goods, datas) {
    override fun convert(helper: BaseViewHolder?, item: ShopGoodsBean.GoodsListBean.GoodsInfoBean.DataBean?) {
        item ?: return
        helper ?: return
        ImageLoader.load(item.goods_image, helper.getView(R.id.iv_goods_image))
        helper.setText(R.id.tv_goods_name, item.goods_name + " " + item.goods_serial)
            .setText(R.id.tv_goods_price, "¥" + item.goods_price)
    }

}
